<include file="Public:header"/>
<body class="J_scroll_fixed">
<div class="wrap jj">
  <div class="common-form">
    <form method="post" class="J_ajaxForm" action="{:U('User/edit')}">
        <input type="hidden" name="userid" value="{$user.userid}">
      <div class="table_full mb5">
          <div class="h_a">会员详细资料</div>
          <table cellpadding="0" cellspacing="0" class="table_form" width="100%">
          <tbody>
          <tr>
              <th width="100">用户:</th>
              <td><font color="#ff0000">{$user.uname}</font></td>
          </tr>
            <tr>
              <th width="100">昵称:</th>
              <td><input type="text" class="input" name="nickname" value="{$user.nickname}"></td>
            </tr>
            <tr>
              <th>邮箱:</th>
              <td><input type="text" class="input" name="uemail" value="{$user.uemail}" ></td>
            </tr>
            <tr>
              <th>手机:</th>
              <td><input type="text" class="input" name="umobile"  value="{$user.umobile}"></td>
            </tr>
            <tr>
                <th>密码:</th>
                <td><input type="password" name="upassword" class="input"></td>
            </tr>
            <tr>
                <th>省/市/区:</th>
                <td><div id="SPCA">{$user.uprovince|showProvince} {$user.ucity|showCity} {$user.uarea|showArea} [ <a href="javascript:showPCA()">修改</a> ]</div>
                    <div id="PCA" style="display: none">
                        <select name="uprovince" id="province" onchange="loadRegion('province','city','{:U('User/getCity')}');">
                            <option value="0" selected>省份/直辖市</option><volist name="province" id="vo">
                                <option value="{$vo.province_id}" >{$vo.province_name}</option></volist>
                        </select>
                        <select name="ucity" id="city"  onchange="loadRegion('city','area','{:U('User/getArea')}');">
                            <option value="0">市/县</option>
                        </select>
                        <select name="uarea" id="area">
                            <option value="0">镇/区</option>
                        </select>
                    </div>
                </td>
            </tr>
            <tr>
                <th>地址:</th>
                <td><input type="text" class="input" size="50" name="uadd" value="{$user.uadd}" ></td>
            </tr>
            <tr>
                <th>头像:</th>
                <td><Form function="images" parameter="uavatar,uavatar,$user['uavatar'],user"/></td>
            </tr>
             <tr>
                <th>审核:</th>
                <td><select name="status">
                        <option value="1" <eq name="user.status" value="1">selected</eq>>通过</option>
                        <option value="0" <eq name="user.status" value="0">selected</eq>>不通过</option>
                    </select>
                </td>
            </tr>
            <tr>
                <th>认证:</th>
                <td><select name="ifrz">
                        <option value="1" <eq name="user.ifrz" value="1">selected</eq>>认证</option>
                        <option value="0" <eq name="user.ifrz" value="0">selected</eq>>未认证</option>
                        <option value="2" <eq name="user.ifrz" value="2">selected</eq>>不通过</option>
                    </select>
                </td>
            </tr>
          </tbody>
        </table>
      </div>
      <div class="btn_wrap">
        <div class="btn_wrap_pd">
          <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">修改</button>
        </div>
      </div>
    </form>
  </div>
</div>
<script src="__JS__/common.js"></script>
<script src="__JS__/content_addtop.js"></script>
<script type="text/javascript">
    function showPCA(){
        jQuery("#SPCA").hide();
        jQuery("#PCA").toggle();
    }

    function loadRegion(sel,selName,url){
        jQuery("#"+selName+" option").each(function(){
            jQuery(this).remove();
        });
        jQuery("<option value=0>请选择</option>").appendTo(jQuery("#"+selName));
        if(jQuery("#"+sel).val()==0){
            return;
        }
        jQuery.getJSON(url,{id:jQuery("#"+sel).val()},
            function(data){
                if(data){
                    jQuery.each(data,function(idx,item){
                        jQuery("<option value="+item.id+">"+item.name+"</option>").appendTo(jQuery("#"+selName));
                    });
                }else{
                    jQuery("<option value='0'>请选择</option>").appendTo(jQuery("#"+selName));
                }
            }
        );
    }
</script>
</body>
</html>